﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Topics_Default" %>
<%@ Register TagPrefix="uc" TagName="Menu" Src="~/Topics/Menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
    <uc:Menu ID="menu" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <ajax:Accordion ID="accordian" SelectedIndex="-1" ToolTip="Click header to show and hide info" RequireOpenedPane="false" HeaderCssClass="header" ContentCssClass="content" CssClass="expandingDetails" runat="server">
        <Panes>
            <ajax:AccordionPane>
                <Header>Topics</Header>
                <Content>
                    Topics are used to organise posts. Topic Groups are created by developers and used in templates.
                </Content>
            </ajax:AccordionPane>
        </Panes>
    </ajax:Accordion>
    <telerik:RadAjaxManager ID="ajaxManager" EnableHistory="true"  DefaultLoadingPanelID="loading" runat="server">
    </telerik:RadAjaxManager>
    <acms:AcmsDataList ID="dlGroups" DataSourceID="dsGroups" UseAjax="false" 
        onitemcreated="dlGroups_ItemCreated" OnItemDataBound="dlGroups_ItemDataBound" DataKeyFields="Id,ConcurencyId" 
        runat="server">
        <ItemStyle CssClass="itemPanel" />
        <ItemTemplate>
            <ajax:Accordion ID="itemAccordian" HeaderCssClass="header" ContentCssClass="content" CssClass="innerExpandingDetails continue" RequireOpenedPane="false" SelectedIndex="-1" runat="server">
                <HeaderTemplate><%#Eval("Name") %></HeaderTemplate>
                <ContentTemplate>
                    <%#Eval("Notes") %>
                </ContentTemplate>
            </ajax:Accordion>
            <div class="horizontalMenu">
                <asp:HyperLink ID="lnkTopic" CssClass="first" NavigateUrl='<%#Eval("Id", "TopicGroup.aspx?GroupId={0}")%>' Text='<%#Eval("Name", "View All \"{0}\" Topics") %>' runat="server"/>
                <asp:HyperLink ID="lnkFiles" CssClass="first" NavigateUrl='<%#Eval("Id", "TopicGroupFiles.aspx?GroupId={0}")%>' Text='<%#Eval("Name", "View All \"{0}\" Topic Files") %>' runat="server"/>
            </div>
            <telerik:RadGrid ID="itemGrid" AllowPaging="true" OnItemDataBound="itemGrid_ItemDataBound" PageSize="5" OnNeedDataSource="itemGrid_NeedDataSource" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" OnItemCommand="itemGrid_ItemCommand" OnDeleteCommand="itemGrid_DeleteCommand" OnUpdateCommand="itemGrid_UpdateCommand" OnInsertCommand="itemGrid_InsertCommand" runat="server">
                <PagerStyle Mode="Slider" />
                <MasterTableView DataKeyNames="Id,ConcurencyId" AutoGenerateColumns="false" EditMode="InPlace" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false" CommandItemDisplay="Bottom" InsertItemPageIndexAction="ShowItemOnLastPage" InsertItemDisplay="Bottom" ShowHeadersWhenNoRecords="true">
                    <Columns>
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" />
                        <telerik:GridBoundColumn DataField="Created" HeaderText="Created" ReadOnly="true" />
                        <acms:RadGridSequenceColumn HeaderText="Sequence" SortExpression="Sequence" SequenceField="Sequence" ShowSequence="false" />
                        <telerik:GridHyperLinkColumn DataTextField="FileCount" DataNavigateUrlFormatString="TopicFiles.aspx?Id={0}&GroupId={1}" DataNavigateUrlFields="Id, TopicGroupId" HeaderText="Files" SortExpression="FileCount"/>
                        <telerik:GridHyperLinkColumn Text="View Posts" DataNavigateUrlFormatString="TopicPosts.aspx?Id={0}&GroupId={1}" DataNavigateUrlFields="Id, TopicGroupId" HeaderText="Posts"/>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton"/>
                        <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" ConfirmTitle="Confirm Delete" ConfirmText="Are you sure you want to delete this topic?" ConfirmDialogType="RadWindow"/>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <telerik:RadAjaxLoadingPanel ID="loading" InitialDelayTime="0" MinDisplayTime="2" Transparency="50" BackColor="DimGray" runat="server" Height="100%"
                Width="100%">
                <img alt="Loading..." src="../icons/loading1.gif" style="border: 0px;" />
            </telerik:RadAjaxLoadingPanel>
        </ItemTemplate>
        <NoDataTemplate>
            Your site is not using topics at the moment. Topic groups are set up by the developer and used in templates. Currrently, no topic groups have been set up. 
        </NoDataTemplate>
    </acms:AcmsDataList>
    <telerik:RadWindowManager ID="winManger" runat="server" />
    <acms:TopicGroupDataSource Id="dsGroups" runat="server" 
        onselectdata="dsGroups_SelectData"/>
    <acms:TopicDataSource ID="dsTopics" runat="server" 
        onselectdata="dsTopics_SelectData">
    </acms:TopicDataSource>
</asp:Content>

